{% extends "menu.html" %}
{% block content %}

        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">



            </div>
            <div class="x_panel">
                  <div class="x_title">
                    <h2>查询</h2>

                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                    <br />
                    <form id="demo-form2" data-parsley-validate class="form-horizontal form-label-left" method="post" enctype="multipart/form-data">
                        {% csrf_token %}
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name"> 选择项目<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select style="margin-top: 5px;width: 60%;height: 30px" name="project_id">


                              {% for project in user_project %}
                              <option value="{{ project.id }}">{{ project.p_name }}</option>
                              {% endfor %}

                          </select>
                        </div>
                      </div>




                        <div class="form-group">
                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12"></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <span>{{ result }}</span>
                        </div>
                      </div>
                      <div class="ln_solid"></div>
                      <div class="form-group">
                        <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                          <button class="btn btn-primary" type="button">Cancel</button>
						  <button class="btn btn-primary" type="reset">Reset</button>
                          <button type="submit" class="btn btn-success">Submit</button>
                        </div>
                      </div>

                    </form>
                  </div>
                </div>
            <div class="clearfix"></div>

                  <div class="x_panel">
                  <div class="x_title">
                    <h2>文章列表</h2>

                    <div class="clearfix"></div>

                  </div>
                  <div class="x_content">
                  <div class="sui-btn-group">
                        <a class="sui-btn btn-bordered btn-primary" href="/article/add/">新建</a>
                  </div>
                  <div class="clearfix"></div>
                    <br />
                    <table class="sui-table table-bordered">
                          <thead>
                            <tr>
                                <th>ID</th>
                                <th>标题</th>
                                <th>作者 </th>
                                <th>版本时间</th>
                                <th>更新者</th>
                                <th>更新时间</th>
                                <th>编辑状态/</th>
                                <th>管理</th>

                            </tr>
                          </thead>
                          <tbody>
                          <style type="text/css">
                             tr:hover{
                                 background-color: #FFFFE0;
                             }
                          </style>
                          {% for i in article_list %}
                            <tr>

                                <td>{{ i.id}}</td>
                                <td><a href="/article/list/?id={{ i.id }}">{{ i.title }}</a></td>
                                <td>{{ i.author }}</td>
                                <td>{{ i.release_time }}</td>
                                <td>{{ i.revisor }}</td>
                                <td>{{ i.update_time }}</td>
                                {% if i.lock_status == "0" %}
                                <td style="color: #1b7e5a">可编辑</td>
                                    <td><a href="/article/update/?id={{ i.id}}" >更新</a>|<a href="/article/delete/?id={{ i.id}}" >删除</a></td>
                                {% else %}
                                  <td style="color: red">锁定编辑中({{ i.lock_user }})</td>
                                    <td><a href="/article/update/?id={{ i.id}}" >更新</a>|<a href="/article/delete/?id={{ i.id}}" >删除</a>|<a href="/article/update_force/?id={{ i.id}}" >强制解锁</a></td>
                                {% endif %}



                            </tr>
                        {% endfor %}
                          </tbody>
                      </table>
                  </div>
                </div>
              </div>
            </div>


          </div>
        </div>
{% endblock %}